import { queryMenu } from './service';
const Model = {
  namespace: 'menuManage',
  state: {
    menuInfo:{
        list: []
    }
  },
  effects: {
    *fetch({ payload }, { call, put }) {
        debugger
      const response = yield call(queryMenu, payload);
      yield put({
        type: 'queryList',
        payload: Array.isArray(response) ? response : [],
      });
    },
  },
  reducers: {
    queryList(state, action) {
       state.menuInfo.list=action.payload;
      return { ...state };
    },
  },
};
export default Model;